The FAT system is known as a format for writing and reading data files to and from information-recording media, such as hard disks. The FAT system, which is normally supported by personal computers loaded with operating systems (OS) such as MS-DOS and WINDOWS (registered trademark), can be described as the most widely-used file format system.
The FAT system will now be described. As shown in FIG. 1, a recording area of a FAT-formatted information-recording medium is divided into physical recording units, each called a sector. Each sector has a predetermined capacity (for example, 512 bytes) and is assigned a sector address. The information-recording medium is accessed on a sector-by-sector basis.
The recording area of the FAT-formatted information-recording medium is divided into logical recording units, each called a cluster, which contains a predetermined number of sectors (for example, 64 sectors). Each cluster is assigned a cluster address. Writing and reading files to and from the information-recording medium is controlled on a cluster-by-cluster basis.
That is, if the size of a file to be recorded is larger than the capacity of a single cluster, the file is divided into a plurality of clusters and recorded. If the size of a file to be recorded is smaller than or equal to the capacity of a single cluster, only that file is recorded in a single cluster.
A file allocation table (hereinafter described as a FAT) and a directory entry that are referred to and updated when writing and reading files are recorded in a predetermined recording area of the information-recording medium.
The FAT provides spaces corresponding to every cluster in the information-recording medium. Therefore, the size of the FAT increases with an increase in the capacity of the information-recording medium. Each space in the FAT is assigned a FAT address.
Information indicating whether a cluster at cluster address CL0 is unused or used is recorded in a space at FAT address 0. If data subsequent to data recorded in the cluster at cluster address CL0 exists, the cluster address of the cluster where the subsequent data is recorded is recorded to indicate that the cluster at cluster address CL0 is used. If no data subsequent to the data recorded in the cluster at cluster address CL0 exists (that is, the file ends with the data recorded in the cluster at cluster address CL0), an end of file (EOF) is recorded.
Similarly, information indicating whether clusters at cluster addresses CL1, 2, 3, . . . are unused or used is recorded in spaces at FAT addresses 1, 2, 3, . . . , respectively.
In the directory entry, the following are recorded for each file: the file name, extension, attributes, recording schedule information, the time of file creation, the date of file creation, the date of last access, the date and time of last update, the cluster address of a cluster where data of the top portion of the file is recorded (hereinafter described as a start cluster address), and the file size.
The cluster address of a cluster where the FAT is recorded and the cluster address of a cluster where the directory entry is recorded are included in management information recorded in the top sector of the information-recording medium. The management information also includes the capacity of the information-recording medium, and information about the number of sectors contained in one cluster.
The directory entry and the FAT will now be specifically described. For example, as shown in FIG. 2, a file A is divided into files A-1 to A-18 and is recorded in respective clusters at cluster addresses CL1, CL2, CL3, CL5, CL6, CL110, CL112, CL113, CL114, CL115, CL116, CL119, CL320, CL323, CL324, CL328, CL329, and CL330 in the information-recording medium.
In this case, cluster address CL1 is recorded, in the directory entry, as the start cluster address of the file A.
In the FAT, as shown in FIG. 3, cluster address CL2 is recorded in a space at FAT address 1, cluster address CL3 is recorded in a space at FAT address 2, and cluster address CL5 is recorded in a space at FAT address 3. The rest are omitted. The EOF is recorded in a space at FAT address 330 at the end. In FIG. 3, information indicating that corresponding clusters are unused is recorded in blank spaces, for example, at FAT address 0, FAT address 4, and FAT address 7. In other words, according to the FAT shown in FIG. 3, clusters, such as at cluster addresses CL0, CL4, and CL7 are free clusters.
The FAT and the directory entry that are updated every time a file is recorded on the information-recording medium, as described above, are used for reading files.
For example, the process of reading the file A from the information-recording medium will be described. First, the directory entry and the FAT, which are recorded on the information-recording medium, are copied to an embedded memory (such as a dynamic random access memory (DRAM)) of a playback apparatus. Then the directory entry in the embedded memory is referred to, the start cluster of the file A (in this case, the cluster address CL1) is read, and the file A-1 is read from the cluster at cluster address CL1.
Subsequently, the FAT in the embedded memory is referred to, the next cluster address CL2 is read from the space at FAT address 1 corresponding to cluster address CL1, and the file A-2 is read from the cluster at cluster address CL2. Then, the FAT in the embedded memory is referred to, the next cluster address CL3 is read from the space at FAT address 2 corresponding to cluster address CL2, and the file A-3 is read from the cluster at cluster address CL3.
Similarly, the files A-4 to A-18 are sequentially read, and the EOF is finally read from FAT address 330 corresponding to cluster address CL330, thereby being recognized that the files have been read until the end. Thus the reading is completed.
The process of recording a file B of a size of about 4 clusters onto the information-recording medium in the state shown in FIG. 2 will be described. First, the directory entry recorded in the information-recording medium and the FAT in the state shown in FIG. 3 are copied to the embedded memory in the recording apparatus.
Then the FAT in the embedded memory is referred to, cluster address CL0 is detected as a free cluster, one cluster of data, which is the first file B-1 from the top of the file B, is recorded in the free cluster at cluster address CL0, and cluster address CL4 is detected as the next free cluster. Cluster address CL4 is then written to the space at FAT address 0 of the FAT corresponding to cluster address CL0.
Next, one cluster of data, which is the second file B-2 from the top of the file B, is recorded in the free cluster at cluster address CL4, and cluster address CL7 is detected as the next free cluster. Cluster address CL7 is then written to the space at FAT address 4 of the FAT corresponding to cluster address CL4.
Next, one cluster of data, which is the third file B-3 from the top of the file B, is recorded in the free cluster at cluster address CL7, and cluster address CL8 is detected as the next free cluster. Cluster address CL8 is then written to the space at FAT address 7 of the FAT corresponding to cluster address CL7.
Next, one cluster of data, which is the fourth file B-4 from the top of the file B, is recorded in the free cluster at cluster address CL8. Since the file B has thus been recorded until the end, the EOF is written in the space at FAT address 8 of the FAT corresponding to cluster address CL8.
Subsequently, the directory entry in the embedded memory is updated (the file name of the file B, the start cluster address CL0, and the like are recorded), and the directory entry and FAT in the embedded memory are written over the directory entry and FAT on the information-recording medium, thereby completing the recording of the file B. Through the process described above, the file B divided into the files B-1 to B-4 is recorded on the information-recording medium as shown in FIG. 4. The FAT recorded on the information-recording medium is updated to the state shown in FIG. 5.
As described above, for reading and writing files according to the FAT system, the FAT is copied from the information-recording medium to the embedded memory and the FAT in the embedded memory is referred to. This is because if, for example, a cluster address is first detected by reference to the FAT on the information-recording medium, and then data is written to and read from a cluster at the detected cluster address, the movement of a head and pickup of the information-recording medium takes time and may cause a delay in reading and writing of data. If the data to be read and written is audio and video (AV) data, played-back images and sounds are interrupted or lost.
To copy the FAT from the information-recording medium to the embedded memory, the capacity of the embedded memory needs to be at least larger than the size of the FAT.
The FAT size, which is proportional to the capacity of the information-recording medium, will be discussed here. If, for example, the capacity of the information-recording medium is 8 gigabytes, one sector is 512 bytes, and one cluster contains 64 sectors, about 250,000 clusters are present in the information-recording medium. Therefore, if one FAT space is bytes, the total size of the FAT is about 1 megabyte.
Therefore, the embedded memory of the recording apparatus or playback apparatus accommodating the information-recording medium of 8 gigabytes needs to have a capacity of at least 1 megabyte.
These days, information-recording media, such as hard disks, have significantly grown in capacity and decreased in size. Moreover, there are information-recording media, such as microdrives, that are small in size, large in capacity, and removable.
For adapting such removable information-recording media to apparatuses for reading and writing files according to the FAT system, the capacity of the embedded memory to which the FAT is copied cannot be uniquely determined, since removable information-recording media are currently available in varying capacities and a further increase in their capacity is expected.
It is possible to set the capacity of an embedded memory based on the expected upper limit of the capacity of a removable information-recording medium. However, this leads to cost inefficiency since an unnecessarily large memory is to be embedded. Moreover, if a removable information-recording medium with a capacity over the expected upper limit becomes available, it cannot be used.